fix(server): interrupt turns after approval cancellation - #5429
Open
t3-code[bot] wants to merge 2 commits into
Open
fix(server): interrupt turns after approval cancellation#5429t3-code[bot] wants to merge 2 commits into
t3-code[bot] wants to merge 2 commits into
Conversation
Contributor
ApprovabilityVerdict: Approved 5c752ea Straightforward bug fix that adds interrupt handling after approval cancellation. The change is limited in scope, includes proper error handling, and has comprehensive test coverage for all edge cases. You can customize Macroscope's approvability policy. Learn more. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
what changed
cancelresponsedeclinescoped to the current requestwhy
Cancelling an approval only answered the request, so Cursor could continue the same turn and immediately ask for more approvals.
ui changes
None.
checks
ProviderCommandReactortestsgit diff --checkModel: OpenAI (API model not exposed). Harness: T3bot.
Note
Interrupt provider turn after approval cancellation in
ProviderCommandReactorthread.approval.respondevents, the reactor now callsproviderService.interruptTurnonly when the decision iscanceland the approval response succeeds; declines are forwarded without interrupting.respondToRequestfails, aprovider.approval.respond.failedactivity is recorded and the interrupt is skipped.provider.turn.interrupt.failedactivity is recorded with the active turn ID and error detail.Macroscope summarized 5c752ea.
Note
Medium Risk
Changes approval-handling orchestration and turn interruption timing in the provider reactor, which affects live agent sessions but is narrowly scoped and covered by new tests.
Overview
Fixes a case where cancelling an approval only told the provider the request was cancelled, so the same turn could keep running and prompt for more approvals.
ProviderCommandReactornow callsinterruptTurnonly when the approval decision iscancelandrespondToRequestsucceeds.declinestill only forwards the response (no interrupt). If the approval response fails, the turn is not interrupted. A failed interrupt after a successful cancel is recorded as aprovider.turn.interrupt.failedactivity.New
ProviderCommandReactortests cover decline-without-interrupt, cancel ordering (respond then interrupt), skipped interrupt on failed cancel response, and failed interrupt logging.Reviewed by Cursor Bugbot for commit 5c752ea. Bugbot is set up for automated code reviews on this repo. Configure here.